﻿using Microsoft.Extensions.DependencyInjection;
using Ray.BiliBiliTool.Application.Contracts;

namespace Ray.BiliBiliTool.Application.Extensions;

public static class ServiceCollectionExtension
{
    public static IServiceCollection AddAppServices(this IServiceCollection services)
    {
        services.Scan(scan =>
            scan.FromAssemblyOf<DailyTaskAppService>()
                .AddClasses(classes => classes.AssignableTo<IAppService>())
                .AsImplementedInterfaces()
                .WithTransientLifetime()
        );

        return services;
    }
}
